package com.etone.smartAudit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.etone.smartAudit.domain.Permission;
import com.etone.smartAudit.vo.permission.PermissionSimpleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: sovy
 * @date: 2020/8/5
 * @description:
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    /**
     * 角色权限列表
     *
     * @param roleId 角色id
     * @return
     */
    List<PermissionSimpleVO> findSimpleByRoleId(@Param("roleId") Integer roleId);

    /**
     * 查询权限基本信息
     *
     * @return
     */
    List<PermissionSimpleVO> findListSimple();

    /***
     * 获取指定的角色是否拥有该菜单
     * @param menuId
     * @param roleId
     * @return
     */
    Integer getMenuByRoleIdAndMenuId(@Param("menuId") Integer menuId, @Param("roleId") Integer roleId);
}
